<template>
  <el-dialog
    :model-value="visible"
    title="详情"
    width="600"
    :close-on-click-modal="false"
    @close="cls"
  >
    <li>采购单号：{{ data.product }}</li>
    <li>供应商名称：{{ data.num }}</li>
    <li>费用：{{ data.price }}</li>
  </el-dialog>
</template>

<script setup>
const emits = defineEmits(["close", "refresh"]);
let data;
function cls() {
  emits("refresh"); // 触发刷新事件
  emits("close");
}
async function init(product, num, price) {
  data = {
    product: product,
    num: num,
    price: price
  };
}
const props = defineProps({
  visible: {
    type: Boolean,
    default: false
  }
});

defineExpose({ init });
</script>
